import type { DictionaryModel } from "./dictionary";

export const MemberLevels = {
	非会员: 102200,
	普通会员: 102201,
	银卡会员: 102202,
	金卡会员: 102203,
	黑卡会员: 102204,
} as const;

export const Gender = {
	男: 1,
	女: 2,
} as const;

// biome-ignore lint/suspicious/noExplicitAny: <explanation>
export function enum2Array(target: Record<string, any>): DictionaryModel[] {
	const output: DictionaryModel[] = [];

	for (const [propertyKey, propertyValue] of Object.entries(target)) {
		if (!Number.isNaN(Number(propertyKey))) {
			continue;
		}
		output.push({ value: propertyValue, text: propertyKey });
	}
	return output;
}
